package cc.bluemc.platform.annotation.executerConfig;

import cc.bluemc.platform.annotation.AnnotationExecuterInterface;

import java.lang.annotation.Annotation;

public class ExecuterConfigExecuter implements AnnotationExecuterInterface{

	@SuppressWarnings("unchecked")
	@Override
	public AnnotationExecuterInterface execute(Annotation annotation, Object value) {
		ExecuterConfig config = (ExecuterConfig) annotation;
		Class executerClazz = config.value();
		try {
			AnnotationExecuterInterface executer = (AnnotationExecuterInterface) executerClazz.newInstance();
			return executer;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
